package com.zc.service.two;

import com.zc.service.two.impl.CashNormal;
import com.zc.service.two.impl.CashRebate;
import com.zc.service.two.impl.CashReturn;

public class CashFactory {
    public static CashSuper getInstance(int type, Object data){
        CashSuper cs  = null;
        switch (type){
            case 1:
             cs = new CashNormal();
             break;
            case 2:
                cs= new CashRebate(0.8);
                break;
            case 3:
                cs= new CashReturn((double)data);
                break;
        }
        return cs;
    }
}
